#ifndef ENGINE_HOOK_H
#define ENGINE_HOOK_H
#include "Base.h"
#include "class.h"
#include "struct.h"
#include "Dobby/dobby.h"
#include "ByNameModding/Tools.h"
#include "ByNameModding/fake_dlfcn.h"
#include "ByNameModding/Il2Cpp.h"
#include "xdl/include/xdl.h"  // 添加 xdl 头文件

extern MonoArray<void**>* (*Object_FindObjectsOfType)(void*);
extern bool* ( *Object_IsNativeObjectAlive)(void *object);
extern MonoString* (*Object_get_name)(void*);
extern void* (*Type_GetTypeName)(MonoString*);
extern void* (*il2cpp_thread_attach)(void* domain);
extern void* (*il2cpp_domain_get)();
extern bool m_CachedPtr(void* unity_obj);
extern Transform* (*Component_get_transform)(void* instance);
extern Vector3(* Transform_get_position)(void* instance);
extern Transform* (* GameObject_get_transform)(void* instance);
extern Camera* (*Camera_get_main)();
extern Vector3(*Camera_WorldToScreen)(Camera* camera, Vector3 position);
extern bool* (*get_isTrigger)(void* instance);
extern void(*set_localScale)(Transform* instance,Vector3);

// Add the missing extern declarations:
extern Transform* (*GetBoneTransform)(Animator*,int);
extern bool* (*get_isHuman)(Animator*);
extern Vector3 (*get_forward)(void *instance);

#if defined(__aarch64__)
#define GET_METHOD(assembly, namespace, klass, method, paramCount) \
        (void*)(uintptr_t)Il2CppGetMethodOffset(assembly, namespace, klass, method, paramCount)
#else
#define GET_METHOD(assembly, namespace, klass, method, paramCount) \
        (void*)(uintptr_t)Il2CppGetMethodOffset(assembly, namespace, klass, method, paramCount)
#endif

void initializeFunctionPointers();

#endif